#include<bits/stdc++.h>
#define ll long long
#define L x<<1
#define R x<<1|1
#define mid (l+r>>1)
#define lc L,l,mid
#define rc R,mid+1,r
#define OK Ll<=l&&r<=Rr
#define Root 1,1,n
#define rep(x,y,z) for(int x=(y);x<=(z);x++)
#define per(x,y,z) for(int x=(y);x>=(z);x--)
#define repn(x) rep(x,1,n)
#define repm(x) rep(x,1,m)
#define pb push_back
#define e(x) for(int i=h[x],y=to[i];i;i=nxt[i],y=to[i])
#define E(x) for(auto y:p[x])
#define Pi pair<int,int>
#define ui unsigned ll
inline int read(){int s=0,w=1;char c=getchar();while(c<48||c>57) {if(c=='-') w=-1;c=getchar();}while(c>=48&&c<=57)s=(s<<1)+(s<<3)+c-48,c=getchar();return s*w;}
inline void pf(int x){if(x<0) putchar('-'),x=-x;if(x>9)pf(x/10);putchar(x%10+48);}
using namespace std;
const int N=1e5+5,M=7e6+5,inf=(1LL<<31)-1,mod=1e9+7;
const ll llf=1e18;
inline void add(int &a,int b){((a+=b)>=mod) and (a-=mod);}
inline int Add(int a,int b){return add(a,b),a;}
inline int mul(int a,int b){return 1LL*a*b%mod;}
inline void Mul(int &a,int b){a=mul(a,b);}
inline void red(int &a,int b){add(a,mod-b);}
inline int Red(int a,int b){return red(a,b),a;}
inline int qp(int a,int b){if(!b)return 1;int c=qp(a,b>>1);Mul(c,c);if(b&1)Mul(c,a);return c;}
inline int INV(int x){return qp(x,mod-2);}
int n,m,ps,ans,a[N];
string s;
inline void baoli(int pos){
	if(pos==n+1){
		int w=0;
		rep(i,1,n-1)w^=a[i]*a[i+1];
		add(ans,w&((1<<m)-1));
		return;
	}
	if(pos==ps)baoli(pos+1);
	else rep(i,0,(1<<m)-1)a[pos]=i,baoli(pos+1);
}
int dp[1005][32][32];
struct mac{
	int a[4][4];
	mac(){
		memset(a,0,sizeof(a));
	}
	mac friend operator*(mac a,mac b){
		mac c;
		rep(i,0,3)rep(k,0,3)if(a.a[i][k])rep(j,0,3)add(c.a[i][j],mul(a.a[i][k],b.a[k][j]));
		return c;
	}  
}I,S,pw[32];
inline mac Qp(int k){
	mac ans=I;
	int p=0;
	while(k){
		if(k&1)ans=ans*pw[p];
		p++,k>>=1;
	}
	return ans;
}
inline void ins(int x,int y){
	pw[0].a[x][y]=1;
}
inline void subspe(){
	rep(i,0,3)I.a[i][i]=1;
	ins(0,0),ins(0,2),ins(1,1),ins(1,3),ins(2,0),ins(2,3),ins(3,1),ins(3,2);
	S.a[0][0]=S.a[2][0]=1;
	rep(i,1,30)pw[i]=pw[i-1]*pw[i-1];
	mac K=Qp(n-2);
	S=K*S;
	cout <<Add(S.a[1][0],S.a[3][0]);
}
inline void Main(){
	n=read(),m=read(),ps=read(),cin>>s,s='#'+s;
	if(ps<=1000)repm(i)if(s[i]=='1')a[ps]+=qp(2,i-1);
	if(n<=8&&m<=3)return baoli(1),cout <<ans,void();
	if(n>1000||m>5)return subspe(),void();
	m=(1<<m)-1;
	if(ps==1)dp[1][a[1]][0]=1;
	else rep(i,0,m)dp[1][i][0]=1;
	rep(i,2,n)
		rep(j,0,m)
			if(!(ps==i&&j!=a[i]))
			rep(k,0,m)
				rep(l,0,m)
					add(dp[i][j][(l^(j*k))&m],dp[i-1][k][l]);
	rep(i,0,m)rep(j,0,m)add(ans,mul(j,dp[n][i][j]));
	cout<<ans;
}
signed main(){
	freopen("pearl.in","r",stdin);
	freopen("pearl.out","w",stdout);
	int T=1;
	while(T--)Main();
	return 0;
}	
